home *** CD-ROM | disk | FTP | other *** search
- #!/usr/bin/perl
- # APC Perls of Wisdom code example, November 2002
- # by Matthew Overington, APC
- # -----------------------------------------------
- # The first line of any Perl program points to where perl is installed on the server
- # As we are running under Linux in the APC office, ours points to the usr/bin/perl folder
-
- if ($ENV{æQUERY_STRINGÆ} =~ /exec/i) {
- &header; # Calls the header subroutine to send a header back to the browser
- &HelloWorld; # Calls the HelloWorld subroutine, which prints Hello World.
- }
-
- # This else block is executed if the correct exec string is not passed from the browser
- # The \n character could confuse a few people; it's the standard perl syntax for a new line
- else {
- &header;
- print "You got that wrong... Try Again.\n<br>";
- }
-
- # We have chosen to put our subroutines at the end of the main program block.
- Sub HelloWorld {
- Print "Hello World\n<br>";
- }
-
- Sub header { # The header subroutine, which is used to alert the browser to the incoming stream
- print "Content-type: text/html\n\n";
- }
-
-
-